package com 
{
	import flash.display.DisplayObject;
	/**
	 * ...
	 * @author db0@qq.com
	 */
	public class ViewSet 
	{
		
		public function ViewSet() 
		{
			
		}
		
		public static function fullCenter(obj:DisplayObject,xx:int,yy:int,ww:int,hh:int):void
		{
			var scalex:Number = ww / obj.width;
			var scaley:Number = hh / obj.height;
			
			obj.x = xx;
			obj.y = yy;
			obj.scaleX = obj.scaleY = Math.min(scalex, scaley);
			if (scalex > scaley) obj.x = xx + (ww - obj.width) / 2;
			if (scalex <= scaley) obj.y = yy + (hh - obj.height) / 2;
		}
		
	}

}